/*
 * @ : Copyright (c) 2021 Phytium Information Technology, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0.
 *
 * @Date: 2021-04-07 09:53:07
 * @LastEditTime: 2021-07-22 17:50:41
 * @Description:  This files is for uart static init
 *
 * @Modify History:
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 */

#include "pl011_uart.h"
#include "parameters.h"

extern Pl011Config Pl011ConfigTable[FT_UART_NUM];

/**
 * @name: Ft_Uart_LookupConfig
 * @msg:  
 * @param {u32} instance_id 
 * @return {*}
 */
Pl011Config *Pl011LookupConfig(u32 instance_id)
{
    Pl011Config *cfg_ptr = NULL;
    u32 index;

    for (index = 0; index < (u32)FT_UART_NUM; index++)
    {
        if (Pl011ConfigTable[index].instance_id == instance_id)
        {
            cfg_ptr = &Pl011ConfigTable[index];
            break;
        }
    }

    return (Pl011Config *)cfg_ptr;
}
